#ifndef STYLEIDDELEGATE_H
#define STYLEIDDELEGATE_H

#include <QStyledItemDelegate>

#include "styleloader.h"

class StyleIdDelegate : public QStyledItemDelegate
{
    Q_OBJECT
public:
    StyleIdDelegate(const QMap<int, Style> &styles, const bool isForTree, QObject *parent = 0);
    void paint(QPainter *painter,
               const QStyleOptionViewItem &option,
               const QModelIndex &index) const;
    QSize sizeHint(const QStyleOptionViewItem &option,
                   const QModelIndex &index) const;

    void generateFallStyleImg();

private:
    QMap<int, Style> mStyles;
    bool mIsForTree;

    QPixmap *mFallStyleImg;
};

#endif // STYLEIDDELEGATE_H
